<!DOCTYPE html>
<html lang="en" manifest="/header.appcache">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <meta name="author" content="chinadangmai.com">
        <meta name="description" content=" ">
        <meta name="keywords" content=" ">
        <meta http-equiv="Access-Control-Allow-Origin" content="*">
        <title> -我的订单</title>   
        <script src="../../js/edition.js"></script> 
        <link rel="stylesheet" href="../../css/base.css">
        <link rel="stylesheet" href="../../css/popover.css">
        <script>
                document.write("<l"+"ink rel='stylesheet' href='../../css/index.css?version="+edition+"'>")
        </script>
        <script>
                document.write("<l"+"ink rel='stylesheet' href='../../css/member.css?version="+edition+"'>")
        </script>
        <script src="../../js/jquery.js"></script>
        <script src="../../js/template.js"></script>
        <script src="../../js/jquery.cookie.js"></script>
        <script> 
                document.write("<s"+"cript type='text/javascript' src='../../js/url.js?version="+edition+"'></scr"+"ipt>"); 
        </script>
        <script src="../../js/popover.js"></script>
        <script> 
                document.write("<s"+"cript type='text/javascript' src='../../js/header.js?version="+edition+"'></scr"+"ipt>"); 
        </script>
        <script> 
                document.write("<s"+"cript type='text/javascript' src='../../js/member_left_nav.js?version="+edition+"'></scr"+"ipt>"); 
        </script>
        
    </head>
    <body style="background:#f5f5f5;">
        <input type="hidden" name="" class="type" value="5">
        <header class="mod_head"></header>
        <script>
            $(function(){
                var src=$('.mod_logo img').attr('src')
                $('.mod_logo img').attr('src','../'+src)
            
            }); 
        </script>
        <div class="mod_backstage">
            <!-- 左侧菜单 start -->
            <div class="backstage_left"></div>
            <!-- 左侧菜单 end -->
            <!-- 右侧内容 start -->
            <div class="backstage_right">
                <div class="mod_route">
                    <a><span>我的位置：</span><span>个人中心&nbsp;</span><span>&gt;&nbsp;</span><span>安全中心</span></a>
                </div>
                <div class="member_right_box">
                    <div class="mod_right_tit">
                        <span class="home_tit_name">修改登录密码</span>
                    </div>
                    <div class="change_passwd_box">
                        <div class="passwd_box">
                            <span>请输入原密码</span>
                            <div class="input_box"></div>
                            <input type="password" class="passwd_input" id="originalPassword">
                        </div>
                        <div class="passwd_box">
                            <span>请输入新密码</span>
                            <div class="input_box"></div>
                            <input type="password" class="passwd_input" id="newPassword" maxlength="18">
                        </div>
                        <div class="passwd_box">
                            <span>请确认新密码</span>
                            <div class="input_box"></div>
                            <input type="password" class="passwd_input" id="confirmPassword" maxlength="18">
                        </div>
                        <a href="javascript:;" class="comfirm_changepwd">确认修改</a>
                    </div>
                </div>
            </div>
            <!-- 右侧内容 end -->
        </div>
        <script>
            $(function(){
                
            })
        </script>
        <!-- 网站底部 start -->
        <footer class="mod_foot"></footer>
        <!-- 网站底部 end -->
        <script src="../../js/index_foot.js"></script>
        <script src="../../js/order_this.js"></script>
        <script>
            $(function(){
                
                if($.cookie('user')!=''&&$.cookie('user')!=null){
                    var token=''; 
                    isLogin();   
                    getToken(); 
                    if( token=='' || token==null){
                        window.location.href='/login/login.html?type=2'
                    }else{
                        $(".comfirm_changepwd").click(function(){
                            var originalPassword = $("#originalPassword").val();
                            var newPassword = $("#newPassword").val();
                            var confirmPassword = $("#confirmPassword").val();
                            if(originalPassword != '' && newPassword != '' && confirmPassword != ''){
                                var data={
                                    originalPassword:originalPassword,
                                    newPassword:newPassword,
                                    confirmPassword:confirmPassword,
                                    token:token
                                }
                                $.ajax({
                                    type:'post',
                                    url:new_url+'shop/home/updatePassword',
                                    dataType:'json',
                                    data:data,
                                    success:function(data){
                                        if(data.code == '0'){
                                            tc(data.message);
                                            setTimeout(function(){
                                                window.location.href='member_security_center.html'
                                            },1000);
                                        }else{
                                            tc(data.message);
                                            $('input').val('');
                                        }
                                    }  
                                });
                            }else{
                                tc("不能为空");
                            }
                        })
                    }
                }else{
                    window.location.href='../login/login.html?type=2'
                }
                // 导航栏显示已登录
                function isLogin(){
                    $('.yes_or_no').remove();
                    $('.mod_login').addClass('mod_login2')
                    var nav=''
                    nav+='<span class="hello" style="margin-left:50px;">您好，</span><span class="nike_name">二傻子大熊</span>'
                    // nav+='<span class="avater"><img src="images/base/touxiang.jpg" alt=""></span>'
                    nav+='<i class="icon_down"></i>'
                    nav+='<ul class="logined">'
                    nav+='<li class="member_center"><a href="member_index.html"><i></i><span>会员中心</span></a></li>'
                    nav+='<li class="login_out"><a href="javascript:;"><i></i><span>退出登录</span></a></li>'
                    nav+='</ul>'
                    $('.mod_login').append(nav);
                }
                // 获取/验证token
                function getToken(){
                    strs=$.cookie('user').split(",");
                    for(var i in strs){
                        // console.info(strs[i])
                        $('.nike_name').html(strs[1])
                        // $('.avater img').attr('src',strs[3])
                        token=strs[6];
                        name=strs[1];
                    }
                }
                // 退出登录
                $('.login_out').click(function(){
                    $.cookie('user', null, { path: '/' });
                    $.ajax({
                        type:'post',
                        url:new_url+'shop/login/logOut',
                        dataType:'json',
                        data:'',
                        success:function(data){
                            tc(data.message);
                        }  
                    })
                    setTimeout(function(){
                        window.location.href='/index.html'
                    },1000);
                });
            });
        </script>
        <script>
            $(function(){
                var w_h=$(window).height();
                // console.info(w_h);
                $('.backstage_right').css('min-height',(w_h-366)+'px');
            })
        </script>
    <script> 
        document.write("<s"+"cript type='text/javascript' src='../../js/nav_hover.js?version="+edition+"'></scr"+"ipt>"); 
    </script> 
    <script>
        $(function(){
            // 底部小图标路径修改
            $('.foot_list>img').each(function(){
                var src = $(this).attr('src');
                $(this).attr('src','../../'+src);
            });
            // 底部链接修改
            $('.footer_ul a').each(function(){
                var newHref = $(this).attr('href');
                if(newHref!='javascript:;'){
                    $(this).attr('href','..'+newHref);
                }
            });
        });
    </script>      
    </body>
</html>